<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">
	<title><?php echo C('SERVER_NAME');?></title>
	<link rel="stylesheet" type="text/css" href="/Public/admin/css/login.css">
</head>
<body>
	<div class="login">
		<div class="login-img"><img src="/Public/admin/images/login-logo.png"></div>
		<div class="login-box">
			<form method="post" action="http://baidu.com">
				<div class="login-form formIpt"><input id="idInput" type="text" value="admin" placeholder="用户名"></div>
				<div class="login-form formIpt"><input id="pwInput" type="password" value="111111" placeholder="密码"></div>
				<div class="login-form formIpt"><input id="verification" type="text" placeholder="验证码"><div class="code-img"><img src="<?php echo U('Home/Login/yanzheng');?>" onclick='this.src=this.src+"?"+Math.random();'/></div></div>
				<div class="login-btn"><a href="javascript:void(0);" class="btnlogin">登&nbsp;&nbsp;&nbsp;&nbsp;录</a></div>
			</form>
		</div>
	</div>
	<div class="footer">
		<div class="copyrig">Copynizhi2011-2017&nbsp;all&nbsp;right&nbsp;reserted&nbsp;蛙推&nbsp;WHYIT-VIF</div>
	</div>
	

<div class="layer-box">
		<div class="layer-gray">
			<div class="text"></div>
		</div>
	</div>



	<script src="/Public/js/jquery-1.7.min.js"></script>
	<script src="/Public/admin/js/page.js"></script>
	<script type="text/javascript">
		$(function () {
			$(".btnlogin").click(function () {

				var username=$("#idInput").val(),
				password=$("#pwInput").val(),
				code=$("#verification").val();

				if (username=="") {
					 prompting("账号不能为空");
		            return false;
				}else if (password=="") {
					 prompting("密码不能为空");
		            return false;
				}else if (code=="") {
					 prompting("验证码不能为空");
		            return false;
				}else{
					 $.post('/Admin/Login/login', {username:username,password:password,code:code}, function(data) {

					 	  var o = eval("("+data+")");// 将json转换为对象 json 格式
					 	  if(o.code==100){
					 	  	prompting(o.mess); return false;
					 	  }else{
					 	  	window.location.href="/Admin/Index/index.html";		
					 	  }
				 	});
				}
			})

		})
	</script>
</body>
</html>